<template>
  <div class="goodlist">
    <div class="goodsBox" v-for="(item, index) in goodsList" :key="index" @click="goDetail(item.id)">
      <div class="photo">
        <img :src="item.imgUrl" alt="" />
        <div class="des">{{ item.content }}</div>
      </div>
      <div class="name">{{ item.name }}</div>
      <div class="price">{{ item.price }}元</div>
    </div>
  </div>
</template>

<script>

export default {
  props:['goodsList'],
  data() {
    return {
     
    };
  },
  methods: {
    goDetail(id){
      this.$router.push({path:'/detail',query:{id}})
      
     
    }
    
  },
 
};
</script>

<style scoped lang='scss'>
.photo {
  position: relative;
  width: 4.4146rem;
  height: 4.4146rem;
  margin: 0 auto;

  img {
    width: 100%;
    height: 100%;
  }
  .des {
    width: 100%;
    padding: 0.1rem 0;
    padding-left: 0.4rem;
    box-sizing: border-box;
    position: absolute;
    left: 0;
    bottom: 0;
    color: white;
    background-color: rgba($color: #000000, $alpha: 0.5);
  }
}
.goodlist {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.goodsBox {
  .name {
    font-size: 0.3415rem;
    padding: 0.1073rem 0;
  }
  .price {
    font-size: 0.439rem;
    color: #ff6600;
    padding: 0.122rem 0;
  }

  font-size: 0.3415rem;
  padding: 0.2rem 0.2rem 0.1rem;
  background: #fff;
  width: 49.5%;
  margin-bottom: 2vw;

  box-sizing: border-box;
}
</style>